package org.jwxa.jwxa4j.parser;

import org.jsoup.nodes.TextNode;
import org.jwxa.jwxa4j.nodes.WXNode;
import org.jwxa.jwxa4j.nodes.WXTextNode;

/**
 * 构建Text节点
 * @author janjan, xujian_jason@163.com
 *
 */
public class TextNodeBuilder implements TreeBuilder {

	@Override
	public WXNode build(Object object) {
		if(object == null) {
			return null;
		}
		// text节点
        TextNode jsoupTextNode = (TextNode) object;
        WXNode wxChildNode = new WXTextNode(jsoupTextNode.text());
		return wxChildNode;
	}

}
